import pyautogui
import time

def transfer(x,y):
    im = pyautogui.screenshot().getpixel((x,y))
    print(im)
    
    #if(pic == None):
    #    return 0
    #else:
    #    return 1
    
def findPic():
    pic = pyautogui.locateOnScreen('img/trans.bmp')
    print(pic)

def gotoPoint(a):
    choice_dict = {0:352520,1:353544,2:353573,3:354613}
    return int(choice_dict[a]/1000), choice_dict[a]%1000

def get_XY_color(x,y):
    return pyautogui.screenshot().getpixel((x, y)) 

def waitForLoading():
    color = get_XY_color(908, 1012)
    print(color)
    while(color[0]!= 105 and color[1]!= 254 and color[2]!= 126):
        color = get_XY_color(908, 1012)
        print("not OK")
        time.sleep(1)
    print("That's OK")


if __name__ == '__main__':
    #time.sleep(1)
    # if(transfer()):
    #     print("找到了")
    # else:
    #     print("没找到")
    #findPic()
    #print(get_XY_color(820,392))
    #waitForLoading()
    print(gotoPoint(0)[0])
    